package com.cfpamf.ms.insur.pay.facade.api;

import com.cfpamf.common.ms.result.Result;
import com.cfpamf.ms.insur.pay.facade.config.PayFacadeConfiguration;
import com.cfpamf.ms.insur.pay.facade.dto.PayOrderDTO;
import com.cfpamf.ms.insur.pay.facade.dto.PreCreateOrderDTO;
import com.cfpamf.ms.insur.pay.facade.dto.QueryOrderDTO;
import com.cfpamf.ms.insur.pay.facade.dto.RefundOrderDTO;
import com.cfpamf.ms.insur.pay.facade.vo.PayOrderVO;
import com.cfpamf.ms.insur.pay.facade.vo.PreCreateOrderVO;
import com.cfpamf.ms.insur.pay.facade.vo.QueryOrderVO;
import com.cfpamf.ms.insur.pay.facade.vo.RefundOrderVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 保险支付接口
 *
 * @author zhangnayi
 */
@FeignClient(name = "insurance-pay", url = "${insurance-pay.url}"
        , configuration = PayFacadeConfiguration.class)
public interface InsurPayFacade {

    /**
     * 预下单接口
     *
     * @param params
     * @return
     */
    @PostMapping("/insurPay/preCreateOrder")
    Result<PreCreateOrderVO> preCreateOrder(@RequestBody PreCreateOrderDTO params);

    /**
     * 订单支付接口
     *
     * @param params
     * @return
     */
    @PostMapping("/insurPay/payOrder")
    Result<PayOrderVO> payOrder(@RequestBody PayOrderDTO params);

    /**
     * 订单查询接口
     *
     * @param params
     * @return
     */
    @PostMapping("/insurPay/queryOrderInfo")
    Result<QueryOrderVO> queryOrderInfo(@RequestBody QueryOrderDTO params);


    /**
     * 订单退款接口
     *
     * @param params
     * @return
     */
    @PostMapping("/insurPay/refundOrder")
    Result<RefundOrderVO> refundOrder(@RequestBody RefundOrderDTO params);
}
